package com.scorpio.server.inter;

import com.scorpio.baen.UserInfo;

import java.nio.channels.SocketChannel;

/**
 * Created by BLACK on 2017/8/1.
 */
public interface NetworkMsgObserver {
    /**
     * 有新的链接的时候
     * @param client
     */
    void doNewConnect(SocketChannel client,UserInfo user);

    /**
     * 断开连接的时候
     * @param client
     */
    void doDisConnect(SocketChannel client,UserInfo user);

    /**
     * 收到客户发来的消息
     * @param client
     * @param msg
     * @return
     */
    void doNetworkMessage(SocketChannel client, UserInfo user, String msg);

    /**
     * 发送消息给客户
     * @param client
     * @return
     */
    String doSendMessage(SocketChannel client,UserInfo user);
}
